import Pageable = Api.Common.Pageable;
import Page = Api.Common.Page;
import {request} from '../request';


/** 模板分页查询 */
export function fetchGetTemplatePage(params?: Pageable) {
  return request<Page<Api.Entity.Template>>({
    url: '/template/page',
    method: 'post',
    data: params
  });
}

export function fetchSaveTemplate(params: Api.Entity.Template) {
  return request<Api.Entity.Template>({
    url: '/template/save',
    method: 'post',
    data: params
  });
}

export function fetchDeleteTemplate(ids: number[]) {
  return request<Api.Entity.Template>({
    url: '/template/delete',
    method: 'post',
    data: {
      ids: ids
    }
  });
}

export function fetchUpdateTemplate(params: Api.Entity.Template) {
  return request<Api.Entity.Template>({
    url: '/template/update',
    method: 'post',
    data: params
  });
}

export function fetchGetTemplate(id: number) {
  return request<Api.Entity.Template>({
    url: '/template/get',
    method: 'post',
    data: {
      id: id
    }
  });
}

export function fetchSaveTemplateBody(params: Api.Entity.Template) {
  return request<Api.Entity.Template>({
    url: '/template/saveBody',
    method: 'post',
    data: params
  });
}

export function fetchSaveTemplateRole(params: Api.Entity.Template) {
  return request<Api.Entity.Template>({
    url: '/template/saveRole',
    method: 'post',
    data: params
  });
}

export function fetchSaveTemplateBaseParameter(params: Api.Entity.Template) {
  return request<Api.Entity.Template>({
    url: '/template/saveBaseParameter',
    method: 'post',
    data: params
  });
}

export function fetchSaveFormData(params: Api.Entity.Template) {
  return request<Api.Entity.Template>({
    url: '/template/saveFormData',
    method: 'post',
    data: params
  });
}

export function fetchSaveFlowData(params: Api.Entity.Template) {
  return request<Api.Entity.Template>({
    url: '/template/saveFlowData',
    method: 'post',
    data: params
  });
}
export function  fetchGetUserList(params?: Pageable) {
  return request<Page<Api.Entity.User>>({
    url: '/template/user-list',
    method: 'post',
    data: params
  });
}

export function  fetchGetRoleList(params?: Pageable) {
  return request<Page<Api.Entity.Role>>({
    url: '/template/role-list',
    method: 'post',
    data: params
  });
}
export function fetchRole(params?: any) {
  return request<Api.Entity.Role>({
    url: '/template/getRole',
    method: 'post',
    data: params
  });
}

export function fetchByUsername(params?: any) {
  return request<Api.Entity.User>({
    url: '/template/getUser',
    method: 'post',
    data: params
  });
}

export function modelDeploy(params?: any) {
  return request<string>({
    url: '/template/modelDeploy',
    method: 'post',
    data: params
  });
}







